//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "framework\fn_initClient.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

If (GVAR(CLIENT)) then {
	0 spawn {
		if (isnil QGVAR(CLIENT_INITIALIZED)) then {
			INFO("     <[]>---- Client : Mission Framework Initializing ----<[]>     ");
			[] call FFUNC(loadJIPVariables);
			[] spawn FFUNC(loadMarkers);
			GVAR(CLIENT_INITIALIZED) = true;
		};
		waituntil{!isnull player && {alive player}};
		
		If (!GVAR(HCCLIENT)) then {
			INFO("     <[]>---- Client : Mission Framework Loading ----<[]>     ");
			[] spawn FFUNC(initializeObjects);
			[] spawn FFUNC(loadTasks);
			// 0 spawn {
				// sleep 6;
				// if (!([player] call FFUNC(hasRadio))) then {
					// [("STR_TMF_EQUIP_RADIO" call FFUNC(translate))] call FFUNC(notification);
				// };
			// };
			[] spawn FFUNC(clientAIActions);
		} else {
			INFO("     <[]>---- HC Client : Mission Framework Loading ----<[]>     ");
		};
	};
};

TRACE("End");
TMFPROFILERSTOP;